package com.geek.javase.wcy03.relation.Work1;

/**
 * @author wangchaoyang
 * @desc TODO
 * @date 2025/9/3
 */
public class TestFly {
    // makeFly 方法：接收 CanFly 类型的参数，调用其 fly() 方法
    public void makeFly(CanFly flyable) {
        flyable.fly();
    }

    public static void main(String[] args) {
        TestFly test = new TestFly();

        // 创建飞机对象和鸟对象
        Plane plane = new Plane();
        Bird bird = new Bird();

        // 调用 makeFly 方法，让飞机和鸟起飞
        test.makeFly(plane);
        test.makeFly(bird);
    }
}